//
//  HZDeleteHistoryKeyWordsFooterView.m
//  app
//
//  Created by 刘华舟 on 15/5/20.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "HZDeleteHistoryKeyWordsFooterView.h"

static const NSInteger kDeleteHistoryButtonHeight = 80;
static const NSInteger kDeleteHistoryButtonWidth = 420;

@implementation HZDeleteHistoryKeyWordsFooterView

-(id)initWithFrame:(CGRect)frame
{
    frame = CGRectOf([UBO_SCREEN fx:UB_LEFT fy:UB_TOP], [UBO_SCREEN fw:UB_WIDTH uh:kDeleteHistoryKeyWordsFooterViewHeight]);
    self = [super initWithFrame:frame];
    if (self) {
        UIButton *clearBtn = [[UIButton alloc] initWithFrame:CGRectOf([self.ubo fx:UB_CENTER ux:-kDeleteHistoryButtonWidth/2 fy:UB_CENTER uy:-kDeleteHistoryButtonHeight/2], [self.ubo uw:kDeleteHistoryButtonWidth uh:kDeleteHistoryButtonHeight])];
        
        
        
        [clearBtn setBackgroundColor:HZ_WHITE_COLOR];
        clearBtn.layer.masksToBounds = YES;
        clearBtn.layer.cornerRadius = [self.ubo uh:8];
        clearBtn.layer.borderColor = HZ_MALL_BORDER_LINE_GRAY_COLOR.CGColor;
        clearBtn.layer.borderWidth = [self.ubo pw:2];
        
        clearBtn.titleLabel.font = JKAppGlobleFontContentText;
        
        [clearBtn setTitle:@"清空历史搜索" forState:UIControlStateNormal];
        [clearBtn setTitleColor:HZ_MALL_TEXT_GRAY_COLOR forState:UIControlStateNormal];
        
        [clearBtn addTarget:self action:@selector(labelDidClicked:) forControlEvents:UIControlEventTouchUpInside];
        
        [self addSubview:clearBtn];
    }
    return self;
}



-(void)labelDidClicked:(UIButton*)label
{
    if (self.tabSelectedCaller) {
        [self.tabSelectedCaller call:label];
    }
}

@end
